﻿<%@ Page Title="Suppliers" Language="C#" MasterPageFile="~/TableMaster.master" AutoEventWireup="true" CodeFile="Suppliers.aspx.cs" Inherits="admin_Suppliers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style>
        @media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) {

            .resTbl tr:nth-of-type(odd) {
                background-color: #CDE2FF;
            }

            .resTbl tr:nth-of-type(1) {
                display: none;
            }

            .resTbl td:nth-of-type(1):before {
                content: "User Code";
            }

            .resTbl td:nth-of-type(2):before {
                content: "Supplier Name";
            }

            .resTbl td:nth-of-type(3):before {
                content: "Supplier Address";
            }

            .resTbl td:nth-of-type(4):before {
                content: "Supplier City";
            }

            .resTbl td:nth-of-type(5):before {
                content: "Supplier State";
            }

            .resTbl td:nth-of-type(6):before {
                content: "Supplier Pincode";
            }

            .resTbl td:nth-of-type(7):before {
                content: "Supplier Primary Contact No";
            }

            .resTbl td:nth-of-type(8):before {
                content: "Supplier Secondary Contact Number";
            }

            .resTbl td:nth-of-type(9):before {
                content: "Supplier Email Id";
            }

            .resTbl td:nth-of-type(10):before {
                content: "Supplier Skype Id";
            }

            .resTbl td:nth-of-type(11):before {
                content: "Payment Information";
            }
            .resTbl td:nth-of-type(12):before {
                content: "Bank Account";
            }
            .resTbl td:nth-of-type(13):before {
                content: "Supplier Agreement";
            }
            .resTbl td:nth-of-type(14):before {
                content: "Fax";

            }
            .resTbl td:nth-of-type(15):before {
                content: "LinkedIn ID";
            }

            .resTbl td:nth-of-type(16):before {
                content: "Tax Vat ID";
            }
            .resTbl td:nth-of-type(17):before {
                content: "Is Active";
            }

            .resTbl td:nth-of-type(18):before {
                content: "Created By";
            }

            .resTbl td:nth-of-type(19):before {
                content: "Created Date";
            }
        }
    </style>
    <script>
        function toggleUploader(fu, btn) {
            $('#' + fu).toggle();
            if ($('#' + fu).is(":visible"))
                $(btn).val('Cancel');
            else
                $(btn).val('Replace');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Add" runat="Server">


    <asp:Panel ID="pnlAdd" runat="server">

        <table cellpadding="0" cellspacing="0" style="width: 100%;">

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblUSER_CODE" runat="server" AssociatedControlID="txtUSER_CODE" Text="User Code:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtUSER_CODE" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_NAME" runat="server" AssociatedControlID="txtSUPPLIER_NAME" Text="Supplier Name:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_NAME" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_ADDRESS" runat="server" AssociatedControlID="txtSUPPLIER_ADDRESS" Text="Supplier Address:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_ADDRESS" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_CITY" runat="server" AssociatedControlID="txtSUPPLIER_CITY" Text="Supplier City:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_CITY" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_STATE" runat="server" AssociatedControlID="txtSUPPLIER_STATE" Text="Supplier State:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_STATE" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_PINCODE" runat="server" AssociatedControlID="txtSUPPLIER_PINCODE" Text="Supplier Pincode:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_PINCODE" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_PRIMARY_CONTACT_NO" runat="server" AssociatedControlID="txtSUPPLIER_PRIMARY_CONTACT_NO" Text="Supplier Primary Contact No:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_PRIMARY_CONTACT_NO" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_SECONDARY_CONTACT_NUMBER" runat="server" AssociatedControlID="txtSUPPLIER_SECONDARY_CONTACT_NUMBER" Text="Supplier Secondary Contact Number:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_SECONDARY_CONTACT_NUMBER" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_EMAIL_ID" runat="server" AssociatedControlID="txtSUPPLIER_EMAIL_ID" Text="Supplier Email Id:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_EMAIL_ID" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblSUPPLIER_SKYPE_ID" runat="server" AssociatedControlID="txtSUPPLIER_SKYPE_ID" Text="Supplier Skype Id:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSUPPLIER_SKYPE_ID" runat="server"></asp:TextBox>
                </td>
            </tr>

            <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-->

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblPayment_Information" runat="server" AssociatedControlID="txtPayment_Information" Text="Payment Information:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtPayment_Information" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblBank_Account" runat="server" AssociatedControlID="txtBank_Account" Text="Bank Account:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtBank_Account" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblAgreement_Document" runat="server" AssociatedControlID="txtAgreement_Document" Text="Supplier Agreement:"></asp:Label>
                </td>
                <td>
                    <asp:FileUpload ID="fuAgreement_Document" runat="server" />
                    <asp:Label ID="txtAgreement_Document" runat="server" style="display:none;" ></asp:Label>
                    <asp:Button ID="btnRemoveAgreement" runat="server" Text="Replace" style="display:none;" OnClientClick="toggleUploader('MainContent_Add_fuAgreement_Document', this);return false;" ToolTip="Replace Agreement" Width="80px" />
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblFax" runat="server" AssociatedControlID="txtFax" Text="FAX:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtFax" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblLinkedIn_ID" runat="server" AssociatedControlID="txtLinkedIn_ID" Text="LinkedIn ID:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtLinkedIn_ID" runat="server"></asp:TextBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblTax_Vat_ID" runat="server" AssociatedControlID="txtTax_Vat_ID" Text="Tax VAT ID:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtTax_Vat_ID" runat="server"></asp:TextBox>
                </td>
            </tr>

            <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-->

            <tr>
                <td style="width: 170px">
                    <asp:Label ID="lblIS_ACTIVE" runat="server" AssociatedControlID="chkIS_ACTIVE" Text="Is Active:"></asp:Label>
                </td>
                <td>
                    <asp:CheckBox ID="chkIS_ACTIVE" runat="server"></asp:CheckBox>
                </td>
            </tr>

            <tr>
                <td style="width: 170px">&nbsp;</td>
                <td>

                    <asp:Button ID="btnSave" runat="server" CssClass="btn btn-success" OnClick="btnSave_Click" Text="Save" Width="90px" />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnCancel" runat="server" CssClass="btn btn-danger" OnClick="btnCancel_Click" Text="Cancel" Width="90px" />

                </td>
            </tr>

        </table>

    </asp:Panel>

</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Grid" runat="Server">
    <asp:Panel ID="pnlList" runat="server">
        <asp:GridView ID="gridClients" runat="server" AutoGenerateColumns="False" CssClass="resTbl" DataSourceID="DS_tbl_supplier_master">
            <Columns>
                <asp:BoundField DataField="USER_CODE" HeaderText="User Code" SortExpression="USER_CODE" />
                <asp:BoundField DataField="SUPPLIER_NAME" HeaderText="Supplier Name" SortExpression="SUPPLIER_NAME" />
                <asp:BoundField DataField="SUPPLIER_ADDRESS" HeaderText="Supplier Address" SortExpression="SUPPLIER_ADDRESS" />
                <asp:BoundField DataField="SUPPLIER_CITY" HeaderText="Supplier City" SortExpression="SUPPLIER_CITY" />
                <asp:BoundField DataField="SUPPLIER_STATE" HeaderText="Supplier State" SortExpression="SUPPLIER_STATE" />
                <asp:BoundField DataField="SUPPLIER_PINCODE" HeaderText="Supplier Pincode" SortExpression="SUPPLIER_PINCODE" />
                <asp:BoundField DataField="SUPPLIER_PRIMARY_CONTACT_NO" HeaderText="Supplier Primary Contact No" SortExpression="SUPPLIER_PRIMARY_CONTACT_NO" />
                <asp:BoundField DataField="SUPPLIER_SECONDARY_CONTACT_NUMBER" HeaderText="Supplier Secondary Contact Number" SortExpression="SUPPLIER_SECONDARY_CONTACT_NUMBER" />
                <asp:BoundField DataField="SUPPLIER_EMAIL_ID" HeaderText="Supplier Email Id" SortExpression="SUPPLIER_EMAIL_ID" />
                <asp:BoundField DataField="SUPPLIER_SKYPE_ID" HeaderText="Supplier Skype Id" SortExpression="SUPPLIER_SKYPE_ID" />
                <asp:BoundField DataField="Payment_Information" HeaderText="Payment Information" SortExpression="Payment_Information" />
                <asp:BoundField DataField="Bank_Account" HeaderText="Bank Account" SortExpression="Bank_Account" />
                <asp:BoundField DataField="Supplier_Agreement_Original_Name" HeaderText="Supplier Agreement" SortExpression="Supplier_Agreement_Original_Name" />
                <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
                <asp:BoundField DataField="LinkedIn_ID" HeaderText="LinkedIn ID" SortExpression="LinkedIn_ID" />
                <asp:BoundField DataField="Tax_Vat_ID" HeaderText="Tax Vat ID" SortExpression="Tax_Vat_ID" />
                <asp:BoundField DataField="IS_ACTIVE" HeaderText="Is Active" SortExpression="IS_ACTIVE" />
                <asp:BoundField DataField="CREATED_BY" HeaderText="Created By" SortExpression="CREATED_BY" />
                <asp:BoundField DataField="CREATED_DATE" DataFormatString="{0:yyMMdd}" HtmlEncode="false" HeaderText="Created Date" SortExpression="CREATED_DATE" />

                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:LinkButton ID="linkEdit" runat="server" Text="Edit" CommandArgument='<%# Eval("USER_CODE") %>' OnClick="linkEdit_Click"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:LinkButton ID="linkDelete" CommandName="delete" runat="server" Text="Delete" OnClientClick="javascript:return confirm('Are you sure you want to delete this record?');" CommandArgument='<%# Eval("USER_CODE") %>' OnClick="linkDelete_Click"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="DS_tbl_supplier_master" runat="server" SelectMethod="selectAll" DeleteMethod="delete" InsertMethod="insert" UpdateMethod="update" TypeName="DAL_tbl_supplier_master">
            <DeleteParameters>
                <asp:Parameter Name="USER_CODE" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="USER_CODE" Type="String" />
                <asp:Parameter Name="SUPPLIER_NAME" Type="String" />
                <asp:Parameter Name="SUPPLIER_ADDRESS" Type="String" />
                <asp:Parameter Name="SUPPLIER_CITY" Type="String" />
                <asp:Parameter Name="SUPPLIER_STATE" Type="String" />
                <asp:Parameter Name="SUPPLIER_PINCODE" Type="String" />
                <asp:Parameter Name="SUPPLIER_PRIMARY_CONTACT_NO" Type="String" />
                <asp:Parameter Name="SUPPLIER_SECONDARY_CONTACT_NUMBER" Type="String" />
                <asp:Parameter Name="SUPPLIER_EMAIL_ID" Type="String" />
                <asp:Parameter Name="SUPPLIER_SKYPE_ID" Type="String" />
                <asp:Parameter Name="Payment_Information" Type="String" />
                <asp:Parameter Name="Bank_Account" Type="String" />
                <asp:Parameter Name="Supplier_Agreement_Original_Name" Type="String" />
                <asp:Parameter Name="Fax" Type="String" />
                <asp:Parameter Name="LinkedIn_ID" Type="String" />
                <asp:Parameter Name="Tax_Vat_ID" Type="String" />
                <asp:Parameter Name="IS_ACTIVE" Type="Boolean" />
                <asp:Parameter Name="CREATED_BY" Type="String" />
                <asp:Parameter Name="CREATED_DATE" Type="DateTime" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="SUPPLIER_NAME" Type="String" />
                <asp:Parameter Name="SUPPLIER_ADDRESS" Type="String" />
                <asp:Parameter Name="SUPPLIER_CITY" Type="String" />
                <asp:Parameter Name="SUPPLIER_STATE" Type="String" />
                <asp:Parameter Name="SUPPLIER_PINCODE" Type="String" />
                <asp:Parameter Name="SUPPLIER_PRIMARY_CONTACT_NO" Type="String" />
                <asp:Parameter Name="SUPPLIER_SECONDARY_CONTACT_NUMBER" Type="String" />
                <asp:Parameter Name="SUPPLIER_EMAIL_ID" Type="String" />
                <asp:Parameter Name="SUPPLIER_SKYPE_ID" Type="String" />
                <asp:Parameter Name="Payment_Information" Type="String" />
                <asp:Parameter Name="Bank_Account" Type="String" />
                <asp:Parameter Name="Supplier_Agreement_Original_Name" Type="String" />
                <asp:Parameter Name="Fax" Type="String" />
                <asp:Parameter Name="LinkedIn_ID" Type="String" />
                <asp:Parameter Name="Tax_Vat_ID" Type="String" />
                <asp:Parameter Name="IS_ACTIVE" Type="Boolean" />
                <asp:Parameter Name="UPDATED_BY" Type="String" />
                <asp:Parameter Name="UPDATED_DATE" Type="DateTime" />
            </UpdateParameters>
        </asp:ObjectDataSource>
    </asp:Panel>
</asp:Content>

